﻿package com.thorqq.magictimer.download;

public class TaskInfo
{
    private int taskid;
    private int fileSize;// 文件大小
    private int complete;// 完成度
    private long createTime;
    private int autoInstall;
    private String urlString;// 下载器标识
    private String localFile;

    private int speed;// 速度
    private int state;//下载状态

    public TaskInfo()
    {
        super();
    }

    public TaskInfo(int fileSize, int complete, String urlstring, int speed)
    {
        super();
        this.fileSize = fileSize;
        this.complete = complete;
        this.urlString = urlstring;
        this.autoInstall = DownloadSvc.AUTO_INSTALL_NO;
        
        this.speed = speed;
        this.state = Downloader.DL_STATE_INIT;
        this.createTime = System.currentTimeMillis();
    }

    public TaskInfo(int taskid, int fileSize, int complete, long createTime, int autoInstall,
            String urlstring, String localFile)
    {
        super();
        
        this.taskid = taskid;
        this.fileSize = fileSize;
        this.complete = complete;
        this.urlString = urlstring;
        this.localFile = localFile;
        this.autoInstall = autoInstall;
        
        this.speed = 0;
        this.state = Downloader.DL_STATE_INIT;
        this.createTime = createTime;
    }

    public TaskInfo(String urlstring, String localFile)
    {
        super();
        
        this.taskid = 0;
        this.fileSize = 0;
        this.urlString = urlstring;
        this.localFile = localFile;
        this.autoInstall = DownloadSvc.AUTO_INSTALL_NO;
        
        this.complete = 0;
        this.speed = 0;
        this.createTime = System.currentTimeMillis();
    }

    public TaskInfo(String urlstring, String localFile, int autoInstall)
    {
        super();
        
        this.taskid = 0;
        this.fileSize = 0;
        this.urlString = urlstring;
        this.localFile = localFile;
        this.autoInstall = autoInstall;
        
        this.complete = 0;
        this.speed = 0;
        this.createTime = System.currentTimeMillis();
    }

    public int getTaskid()
    {
        return this.taskid;
    }

    public void setTaskid(int Taskid)
    {
        this.taskid = Taskid;
    }
    
    public int getFileSize()
    {
        return this.fileSize;
    }

    public void setFileSize(int fileSize)
    {
        this.fileSize = fileSize;
    }

    public int getComplete()
    {
        return this.complete;
    }

    public void setComplete(int complete)
    {
        this.complete = complete;
    }

    public String getUrlstring()
    {
        return this.urlString;
    }

    public void setUrlstring(String urlString)
    {
        this.urlString = urlString;
    }
    
    public String getLocalFile()
    {
        return this.localFile;
    }
    
    public void setLocalFile(String localFile)
    {
        this.localFile = localFile;
    }
    
    public int getSpeed()
    {
        return this.speed;
    }
    
    public void setSpeed(int speed)
    {
        this.speed = speed;
    }

    public int getState()
    {
        return this.state;
    }
    
    public void setState(int state)
    {
        this.state = state;
    }
    
    public long getCreateTime()
    {
        return this.createTime;
    }
    
    public void setCreateTime(long time)
    {
        this.createTime = time;
    }
    
    public int getAutoInstall()
    {
        return this.autoInstall;
    }

    public void setAutoInstall(int a)
    {
        this.autoInstall = a;
    }

    @Override
    public String toString()
    {
        return "TaskInfo [" +
                "taskid=" + taskid + 
                ", fileSize=" + fileSize + 
                ", complete=" + complete + 
                ", state=" + state + 
                ", localFile=" + localFile + 
                "]";
    }

}
